import * as React from 'react';
import { ll } from '../../utils/storage';

interface PorpsType {
  role?: string
  children: JSX.Element | React.ReactElement | React.ReactNode
}
const Promisstion: React.FC<PorpsType> = ({ role, children }) => {
  role = role || 'admin';
  const userInfo = ll.getItem('userInfo') || {};
  if (userInfo.role !== role) return null
  return children as JSX.Element
}


export default Promisstion